function inStru=momentsAssignDefaults(inStru,report,nameStru)
% inStru=momentsAssignDefaults(inStru,report,nameStru)
%
% Given the structure inStru and report, assign default values to all structures used for
% generating Moments.
%
% *Inputs*
%% 1. inStru
%  Default values shown in brackets [ ]
%
% *.NSimVec*, N to Drop and N to Keep in Simulated Moments
%       [100 | 150 ]
%
% *.NRep*, Number of times to replicate the simulations
%       [ 100 ]
%
% *.NCorrel*, Number of Autocorrelations and Autocovariances
%       [ 4 ]
%
% *.NIRF*, Number of Periods for the Impulse Responses
%       [ 8 ]
%
% *.NVarDec*, Number of Decomposition Across Horizons 0,...,NVDec
%       [ 0 ]
%
% *.FlagUnitIRF*, IRFs to Unit Impulse or Unit STD [0]
%
%% 2. Report
% No Default Values, will generate empty assignments
%
% *.stateMom* which will be used for ALL except IRFs. Must match the
% name of the states exactly. If empty, no moments or decompositions for the states will be
% extracted.
%
% *.stateIRF* which will be used for IRFs only. The latter can contain the
% word 'lev', which will determine if this should be added. If empty NO
% IRFS will be extracted
%
% This will generate three fields
%
% *.statePosMom* Position of rows in states to extract (rows of GG) for all
% but IRF
%
% *.statePosIRF* Position of rows in states to extract (rows of GG) for IRFs ONLY
%
% *.addIRFStates* Position of rows of statePosIRF that will be added
%
%
% IRFs of levels will No Longer be added 1/16/2012

%% A. Default Assignments
[~,inStru]=ch_field(inStru,'NSimVec',[100 150]);
[~,inStru]=ch_field(inStru,'NRep',100);
[~,inStru]=ch_field(inStru,'NCorrel',4);
[~,inStru]=ch_field(inStru,'NIRF',8);
[~,inStru]=ch_field(inStru,'NVarDec',0);
[~,inStru]=ch_field(inStru,'flagUnitIRF',0);
%% B. Position Indicators
%% B.1 statePosMom for Moments
if ~isempty(report.stateMom);
    inStru.statePosMom=cellposition(report.stateMom,nameStru.stateNames);
else
    inStru.statePosMom=[];
end
%% B.2 statePosIRF and addStateIRF for IRF
if ~isempty(report.stateIRF);
    [tempPos,flag_adds]=extractlevels(report.stateIRF,nameStru.stateNames);
    inStru.statePosIRF=tempPos;
    inStru.addStateIRF=(flag_adds==1);
else
    inStru.statePosIRF=[];
    inStru.addStateIRF=[];
end
% IRFS for the observables will no longer be added 1/15/2012
% [obs_pos,addobs]=extractlevels(nameStru.reportObs,nameStru.obsNames);
% nameStru.reportObs=nameStru.obsNames(obs_pos);
% inStru.addIRFObs=find(addobs==1);